package UIComponents
{
	import MyComponent.MyButton;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class RewardItemFrame extends Sprite
	{
		private var tf:TextField;
		private var ic:IconContainer;
		
		public function RewardItemFrame()
		{
			init();
		}
		private function init():void
		{
			tf=(this.getChildByName("itemNumSp") as DisplayObjectContainer).getChildByName("txt_num") as TextField;
			ic=this.getChildByName("itemSp") as IconContainer;
		}
		
		public function setItemFrameData(obj:Object):void
		{
			tf.text="0";
			tf.text=obj.itemNum;
			if(null==obj.des ||obj.des=="")
			{
				ic.addPic((obj.itemIcon) as DisplayObject,obj.itemName);
			}else if(null==obj.itemName ||obj.itemName=="")
			{
				ic.addPic((obj.itemIcon) as DisplayObject,obj.des);
			}else{
				ic.addPic((obj.itemIcon) as DisplayObject,(obj.itemName+"："+obj.des));
			}
		}
		
	}
}